void UI_DimLinearOptions::destroy() {
    PF_SETTINGS->beginGroup("/Dimension");
    PF_SETTINGS->writeEntry("/Angle", leAngle->text());
    PF_SETTINGS->endGroup();
}

void UI_DimLinearOptions::setAction(PF_ActionInterface* a, bool update) {
    if (a!=NULL && a->rtti()==LX_Define::ActionDimLinear) {
        action = (WF_DimLinear*)a;

        QString sa;
        if (!update) {
            sa = QString("%1").arg(PF_Math::rad2deg(action->getAngle()));
        } else {
            PF_SETTINGS->beginGroup("/Dimension");
            sa = PF_SETTINGS->readEntry("/Angle", "0.0");
            PF_SETTINGS->endGroup();
        }
        leAngle->setText(sa);
    } else {
        PF_DEBUG->print(PF_Debug::D_ERROR, 
			"UI_DimLinearOptions::setAction: wrong action type");
        action = NULL;
    }
}

void UI_DimLinearOptions::updateAngle(const QString & a) {
    if (action!=NULL) {
        action->setAngle(PF_Math::deg2rad(PF_Math::eval(a)));
    }
}

void UI_DimLinearOptions::setHor() {
    leAngle->setText("0");
}

void UI_DimLinearOptions::setVer() {
    leAngle->setText("90");
}
